package org.seefly.iprint.utils;

import java.util.UUID;

public class UUIDUtils {
    public static String getId() {
        return UUID.randomUUID().toString().replace("-", "").toUpperCase();
    }

    public static String getCode() {
        return getId();
    }

    public static String getUUIDName(String realName) {
        int index = realName.lastIndexOf(".");
        if (index == -1) {
            return UUID.randomUUID().toString().replace("-", "").toUpperCase();
        } else {
            return UUID.randomUUID().toString().replace("-", "").toUpperCase() + realName.substring(index);
        }
    }

}
